<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<%@ page contentType="text/html; charset=utf-8"%>
	<%@ include file="/commons/taglibs.jsp"%>

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
		<title>我的申请列表</title>

		<%@ include file="/commons/css_js_head.jsp"%>


		<script type="text/javascript">
//复写Url
doListUrl = "${ctx }/base/machinesApplyAction!doAddApply.ts";
doAddBeforeUrl = "${ctx }/base/machinesApplyAction!doFindById.ts";
doAddApplyBeforeUrl="${ctx }/base/machinesApplyAction!doAddApply.ts"
doCanceApply = "${ctx }/base/machinesApplyAction!doCanceApply.ts"
//添加之前
function doAddBefore() {
	var _form = document.forms[0];
	if (doListUrl == '') {
		alert('请设置正确的URL!');
		return false;
	}

	_form.action = doListUrl;
	_form.submit();
}

//增加应用之前
function doAddApply(){
	var _form = document.forms[0];
	if (doAddBeforeUrl == '') {
		alert('请设置正确的URL!');
		return false;
	}
	var msid = document.getElementById("msid");
	_form.action = doAddApplyBeforeUrl + "?msid=" + msid.value;
	_form.submit();
}

//更新之前 
function doUpdateBefore(pkId) {
	var _form = document.forms[0];
	if (doUpdateBeforeUrl == '') {
		alert('请设置正确的URL!');
		return false;
	}

	_form.action = doUpdateBeforeUrl + "?machinesId=" + pkId;
	_form.submit();
}

//删除
function doDel(pkId) {
	var _form = document.forms[0];
	if (doDelUrl == '') {
		alert('请设置正确的URL!');
		return false;
	}
	_form.action = doDelUrl + "?machinesId=" + pkId;
	_form.submit();
}
//取消我的申请
function doCance(pkId,status) {

	var _form = document.forms[0];
	if (doCanceApply == '') {
		alert('请设置正确的URL!');
		return false;
	}
	_form.action = doCanceApply + "?maid=" + pkId+"&status="+status;
	_form.submit();
}

//关闭小窗口
function onCancel()
{
	closeWindow();
}
function closeWindow()
{
	self.parent.tb_remove();
}


</script>


	</head>
	<body style="overflow-x: hidden">

		<!-- 标题 -->
		<div class="mTitle">
			<span class="hidsearch"><a href="javascript:void(0)"
				onClick="return chg('searchList');" id="ImgArrow"> <img
						src="${ctx}/images/icon_up.gif" id="imgButton" />
			</a> </span>
			<b class="bbig">我的申请</b>
			
		</div>

		<!--list -->
		<div class="searchBar" id="searchList" style="display: block;">
			<form action="/base/machinesApplyAction!doFindById.ts" method="post">
				<table class="searchTable">
					<tr>
						<th>
							审核人：
						</th>
						<td>
							<s:textfield name="endUserName" theme="simple"></s:textfield>
						</td>
						
						
						<td>
							<input name="btn_query" type="button" class="btn" value="查询"
								onclick="doQuery()" />
							
						</td>
					</tr>
				</table>
			</form>
		</div>
		<div class="mainList">

			<table class="listTable">
				<tr>
					<th>序号</th>
					<th>
						发起人
					</th>
					<th>
						审核人
					</th>
					<th>
						终端
					</th>
					<th>
						应用
					</th>
					<th>
						状态
					</th>
					<th>
						操作
					</th>
				</tr>

				<input type="hidden" value="${msid }" id="msid"/>
				<c:forEach var="applyList" varStatus="status" items="${pager.data}">
					<tr align=center>
						<td>${status.index+1} </td>
						<td>
							${applyList.startUserName }
						</td>
						<td>
							${applyList.endUserName }
						</td>
						<td>
							${applyList.msidName }
						</td>
						<td>
							${applyList.asidName }
						</td>
						<td>
						<c:if test="${applyList.status==1 }">未审核</c:if>
						<c:if test="${applyList.status==0 }">审核通过</c:if>
						<c:if test="${applyList.status==2 }">审核不通过</c:if>
						</td>
						<td>
						<c:if test="${applyList.status==1 || applyList.status==2 }">
						<a href="javascript:void(0)" onclick="javascript:doCance('${applyList.maid }','3');"><span class="icon_del">&nbsp;</span>取消</a>
						</c:if>
						</td>
					</tr>
				</c:forEach>
			</table>
		</div>
		<!--end list -->

		<!-- 分页区域  -->
<%@ include file="/page/pager.jsp"%>

<script type="text/javascript">
ajaxAnywhere.formName = "form1";
ajaxAnywhere.getZonesToReload = function() {
    return "zoneList";
}
</script>

	</body>
</html>
